package edu.ynu.onlinesqltool.action;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import edu.ynu.onlinesqltool.dao.TableDao;
import edu.ynu.onlinesqltool.model.Table;

public class DescribeTableAction implements IAction {

	public void execute(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		String tableName = req.getParameter("tableName");
		Table table = TableDao.DescribeTable(tableName);
		req.setAttribute("table", table);
		RequestDispatcher dispater=req.getRequestDispatcher(resp.encodeURL("/tabledetail.jsp"));
		dispater.forward(req,resp);
	}

}
